/**
 * Copyright &copy; 2021-2026 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.sys.favMenu.service.mapstruct;

import com.jeeplus.core.mapstruct.EntityWrapper;
import com.jeeplus.sys.favMenu.domain.FavMenu;
import com.jeeplus.sys.favMenu.service.dto.FavMenuDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

/**
 * 收藏菜单包装类
 *
 * @author jeeplus
 * @version 2023-09-05
 */
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE, uses = {})
public interface FavMenuWrapper extends EntityWrapper<FavMenuDTO, FavMenu> {

    FavMenuWrapper INSTANCE = Mappers.getMapper(FavMenuWrapper.class);

    /**
     * dto对象转化成entity对象
     */
    @Mappings({
            @Mapping(source = "createBy.id", target = "createBy"),
            @Mapping(source = "updateBy.id", target = "updateBy")
    })
    FavMenu toEntity(FavMenuDTO dto);

    /**
     * entity对象转换成dto对象
     */
    @Mappings({
            @Mapping(source = "createBy", target = "createBy.id"),
            @Mapping(source = "updateBy", target = "updateBy.id")
    })
    FavMenuDTO toDTO(FavMenu entity);

    FavMenu copyEntity(FavMenu entity);

    FavMenuDTO copyDTO(FavMenuDTO dto);
}